<!doctype html>
<html class="no-js">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <link rel="stylesheet" href="__PUBLIC__/resource/assets/css/amazeui.min.css"/>
    <link rel="stylesheet" href="__PUBLIC__/resource/assets/css/admin.css">
    <script src="//cdn.bootcss.com/vue/1.0.24/vue.min.js"></script>
    <style>
        .am-btn-default{background: none}
    </style>
</head>
<body>
<div class="am-cf admin-main2">
    <!-- content start -->
    <div class="admin-content">
        <div class="admin-content-body">
            <div class="am-cf am-padding am-padding-bottom-0">
                <div class="am-fl am-cf">
                    <ol class="am-breadcrumb">
                        <li><a href="{{ url('admin/index/center') }}" class="am-icon-home">后台首页</a></li>
                        <li class="am-active">内容</li>
                    </ol>
                </div>
                <div class="am-fr am-cr">
                    <a class="am-btn am-btn-warning hw-shuaxin" href="javascript:location.replace(location.href);">
                        <i class="am-icon-refresh"></i>
                    </a>
                    <a class="am-btn am-btn-secondary hw-shuaxin tianjia" v-on:click="addschool">
                        <i class="am-icon-plus"></i>
                    </a>
                </div>
            </div>
            <hr>

            <div class="am-g">
                <div class="am-u-sm-12">
                    <form class="am-form">
                        <table class="am-table am-table-striped am-table-hover table-main">
                            <thead>
                            <tr>
                                <!--<th class="table-check"><input type="checkbox" /></th>-->
                                <th class="table-id">ID</th>
                                <th class="table-name">会议名</th>
                                <th class="table-address am-hide-sm-only">会议地点</th>
                                <th class="table-banner">海报</th>
                                <th class="table-logo">logo</th>
                                <th class="table-state">会议状态</th>
                                <th class="table-is_site">是否允许现场报名</th>
                                <th class="table-start_time">签到开始时间</th>
                                <th class="table-end_time">签到结束时间</th>
                                <th class="table-set" width="150">操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            <template v-for="item in list">
                                <tr>
                                    <!--<td><input type="checkbox" /></td>-->
                                    <td>{{ $index+1 }}</td>
                                    <td>{{ item.name }}</td>
                                    <td class="am-hide-sm-only">{{ item.address }}</td>
                                    <td class="am-hide-sm-only"><img :src="item.banner" width="40"></td>
                                    <td class="am-hide-sm-only"><img :src="item.logo" width="40"></td>
                                    <td class="am-hide-sm-only">{{item.state==1?'正常':'关闭'}}</td>
                                    <td class="am-hide-sm-only">{{item.is_site==1?'允许':'不允许'}}</td>
                                    <td class="am-hide-sm-only">{{item.start_time}}</td>
                                    <td class="am-hide-sm-only">{{item.end_time}}</td>
                                    <td>
                                        <div class="am-btn-toolbar">
                                            <div class="am-btn-group am-btn-group-xs">
                                                <a class="am-btn am-btn-default am-btn-xs am-text-secondary" v-on:click.stop="edit(item.id)"><span class="am-icon-pencil-square-o"></span> 编辑</a>
                                                <a class="am-btn am-btn-default am-btn-xs am-text-danger am-hide-sm-only" v-on:click.stop="shanchu(item.id,this)"><span class="am-icon-trash-o"></span> 删除</a>
                                            </div>
                                        </div>
                                    </td>
                                </tr>
                            </template>
                            </tbody>
                        </table>
                        <div class="am-cf" style="padding:0px 30px 30px 30px;margin-bottom: 30px;">
                            <div class="am-fl hw-jilu">共 {{ list.length }} 条记录</div>
                            <div class="am-fr">
                                {$page}
                            </div>
                        </div>
                    </form>
                </div>

            </div>
        </div>
    </div>
    <!-- content end -->
</div>

<!--[if lt IE 9]>
<script src="http://cdn.staticfile.org/modernizr/2.8.3/modernizr.js"></script>
<script src="__PUBLIC__/resource/assets/js/amazeui.ie8polyfill.min.js"></script>
<![endif]-->
<script src="//cdn.bootcss.com/jquery/2.0.2/jquery.min.js"></script>
<script src="__PUBLIC__/resource/layer/layer.js"></script>
<script src="__PUBLIC__/resource/assets/js/amazeui.min.js"></script>
<script src="__PUBLIC__/resource/assets/js/hw-layer.js"></script>
<script src="__PUBLIC__/resource/assets/js/app.js"></script>
<script>
    var vm = new Vue({
        el: 'body',
        data:{list:{$Data}},
        methods: {
            addschool: function (event) {
                layer_show("添加会议","{:U('Conference/add')}",600,700)
            },
            edit: function (id) {
                layer_show("编辑会议",'/admin/Conference/edit/?id='+id,600,700)
            },
            shanchu: function (id,event) {
                layer.msg('确定要删除吗？', {
                    time:0,
                    btn: ['确定', '取消'],
                    yes: function(){
                        $.get('/admin/Conference/del/?id='+id,function (data) {
                            $temp = $.parseJSON(data);
                            if($temp['status'] == "200"){
                                vm.list.$remove(vm.list[event.$index])
                                layer.msg('删除成功！');
                            }else{
                                layer.msg($temp['text']);
                            }
                        })
                    }
                });
            },
        }
    })

</script>
</body>
</html>